Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Comment (computer programming)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Comment_(computer_programming)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Comment_computer_programming rootpage-Comment_computer_programming skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Comment (computer programming)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style>


<p>In <a href="Computer_programming" title="Computer programming">computer programming</a>, a <b>comment</b> is text embedded in <a href="Source_code" title="Source code">source code</a> that a translator (<a href="Compiler" title="Compiler">compiler</a> or <a href="Interpreter_(computing)" title="Interpreter (computing)">interpreter</a>) ignores. Generally, a comment is an <a href="Annotation" title="Annotation">annotation</a> intended to make the code easier for a <a href="Programmer" title="Programmer">programmer</a> to understand – often explaining an aspect that is not readily apparent in the program (non-comment) code.<sup id="cite_ref-PennyGrubb000_1-0" class="reference"><a href="#cite_note-PennyGrubb000-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> For this article, <i>comment</i> refers to the same concept in a <a href="Programming_language" title="Programming language">programming language</a>, <a href="Markup_language" title="Markup language">markup language</a>, <a href="Configuration_file" title="Configuration file">configuration file</a> and any similar context.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Some <a href="Development_tool" class="mw-redirect" title="Development tool">development tools</a>, other than a source code translator, do <a href="Parse" class="mw-redirect" title="Parse">parse</a> comments to provide capabilities such as <a href="API" title="API">API</a> <a href="Documentation_generator" title="Documentation generator">document generation</a>, <a href="Static_analysis" title="Static analysis">static analysis</a>, and <a href="Version_control" title="Version control">version control</a> integration. The <a href="Comparison_of_programming_languages_(syntax)#Comments" title="Comparison of programming languages (syntax)">syntax of comments</a> varies by programming language yet there are repeating patterns in the syntax among languages as well as similar aspects related to comment content.
</p><p>The flexibility supported by comments allows for a wide degree of content style variability. To promote uniformity, style conventions are commonly part of a <a href="Programming_style" title="Programming style">programming style</a> guide. But, <a href="Best_practice" title="Best practice">best practices</a> are disputed and contradictory.<sup id="cite_ref-Dietrich000_3-0" class="reference"><a href="#cite_note-Dietrich000-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Keyes000_4-0" class="reference"><a href="#cite_note-Keyes000-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Common_attributes">Common attributes</h2></div>
<p>Support for code comments is defined by each programming language. The features differ by language, but there are several common attributes that apply throughout.
</p><p>Most languages support multi-line block (a.k.a. stream) and/or single line comments. A <b>block comment</b> is <a href="Delimiter#Bracket_delimiters" title="Delimiter">delimited</a> with text that marks the start and end of comment text. It can span multiple lines or occupy any part of a line. Some languages allow block comments to be recursively nested inside one another, but others do not.<sup id="cite_ref-Higham000_5-0" class="reference"><a href="#cite_note-Higham000-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Vermeulen000_6-0" class="reference"><a href="#cite_note-Vermeulen000-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-javadude000_7-0" class="reference"><a href="#cite_note-javadude000-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> A <b>line comment</b> ends at the end of the text line. In modern languages, a line comment starts with a delimiter but some older languages designate a column at which subsequent text is considered comment.<sup id="cite_ref-javadude000_7-1" class="reference"><a href="#cite_note-javadude000-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> Many languages support both block and line comments – using different delimiters for each. For example, <a href="C_(programming_language)" title="C (programming language)">C</a>, <a href="C%2B%2B" title="C++">C++</a> and their many derivatives support block comments delimited by <code>/*</code> and <code>*/</code> and line comments delimited by <code>//</code>. Other languages support only one type of comment.<sup id="cite_ref-javadude000_7-2" class="reference"><a href="#cite_note-javadude000-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><p>Comments can also be classified as either prologue or inline based on their position and content relative to program code. A <b>prologue comment</b> is a comment (or group of related comments) located near the top of an associated programming topic, such as before a symbol declaration or at the top of a file. An <b>inline comment</b> is a comment that is located on the same line as and to the right of program code to which is refers.<sup id="cite_ref-JBDixit000_8-0" class="reference"><a href="#cite_note-JBDixit000-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> Both prologue and inline comments can be represented as either line or block comments. For example:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="cm">/*</span>
<span class="cm"> * prologue block comment; if is about foo()</span>
<span class="cm"> */</span>
<span class="kt">bool</span><span class="w"> </span><span class="nf">foo</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="nb">true</span><span class="p">;</span><span class="w"> </span><span class="cm">/* inline block comment; if is about this return */</span>
<span class="p">}</span>

<span class="c1">//</span>
<span class="c1">// prologue line comment; if is about bar()</span>
<span class="c1">//</span>
<span class="kt">bool</span><span class="w"> </span><span class="nf">bar</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="nb">false</span><span class="p">;</span><span class="w"> </span><span class="c1">// inline line comment; if is about this return</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Examples_of_use">Examples of use</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Describe_intent">Describe intent</h3></div>
<p>Comments can explain the author's intent – <i>why</i> the code is as it is. Some contend that describing <i>what</i> the code does is superfluous. The need to explain the <i>what</i> is a sign that it is too complex and should be re-worked.
</p>
<dl><dd>"Don't document bad code – rewrite it."<sup id="cite_ref-BadComment000_9-0" class="reference"><a href="#cite_note-BadComment000-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></dd></dl>
<dl><dd>"Good comments don't repeat the code or explain it. They clarify its intent. Comments should explain, at a higher level of abstraction than the code, what you're trying to do."<sup id="cite_ref-GoodComment000_10-0" class="reference"><a href="#cite_note-GoodComment000-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup></dd></dl>
<div class="mw-heading mw-heading3"><h3 id="Highlight_unusual_practice">Highlight unusual practice</h3></div>
<p>Comments may explain why a choice was made to write code that is counter to convention or best practice. For example:
</p>
<div class="mw-highlight mw-highlight-lang-vbscript mw-content-ltr" dir="ltr"><pre><span class="c1">' Second variable dim because of server errors produced when reuse form data.</span>
<span class="c1">' No documentation available on server behavior issue, so just coding around it.</span>
<span class="n">vtx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">server</span><span class="p">.</span><span class="n">mappath</span><span class="p">(</span><span class="s2">"local settings"</span><span class="p">)</span>
</pre></div>
<p>The example below explains why an <a href="Insertion_sort" title="Insertion sort">insertion sort</a> was chosen instead of a <a href="Quicksort" title="Quicksort">quicksort</a>, as the former is, in theory, slower than the latter.
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="w"> </span><span class="n">list</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">[</span><span class="n">f</span><span class="w"> </span><span class="p">(</span><span class="n">b</span><span class="p">),</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="p">(</span><span class="n">b</span><span class="p">),</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="p">(</span><span class="n">c</span><span class="p">),</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="p">(</span><span class="n">d</span><span class="p">),</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="p">(</span><span class="n">a</span><span class="p">),</span><span class="w"> </span><span class="p">...</span><span class="o">]</span><span class="p">;</span>
<span class="w"> </span><span class="c1">// Need a stable sort. Besides, the performance really does not matter.</span>
<span class="w"> </span><span class="n">insertion_sort</span><span class="w"> </span><span class="p">(</span><span class="n">list</span><span class="p">);</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Describe_algorithm">Describe algorithm</h3></div>
<p>Comments can describe an algorithm as <a href="Pseudocode" title="Pseudocode">pseudocode</a>. This could be done before writing the code as a first draft. If left in the code, it can simplify <a href="Code_review" title="Code review">code review</a> by allowing comparison of the resulting code with the intended logic. For example:
</p>
<div class="mw-highlight mw-highlight-lang-cpp mw-content-ltr" dir="ltr"><pre><span class="cm">/* loop backwards through all elements returned by the server </span>
<span class="cm">(they should be processed chronologically)*/</span>
<span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">numElementsReturned</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">--</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="cm">/* process each element's data */</span>
<span class="w"> </span><span class="n">updatePattern</span><span class="p">(</span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="n">returnedElements</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
<span class="p">}</span>
</pre></div>
<p>Sometimes code contains a novel or noteworthy solution that warrants an explanatory comment. Such explanations might be lengthy and include diagrams and formal mathematical proofs. This may describe what the code does rather than intent, but may be useful for maintaining the code. This might apply for highly specialized problem domains or rarely used optimizations, constructs or function-calls.<sup id="cite_ref-AlgoComments_11-0" class="reference"><a href="#cite_note-AlgoComments-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Reference">Reference</h3></div>
<p>When some aspect of the code is based on information in an external reference, comments link to the reference. For example as a URL or book name and page number.
</p>
<div class="mw-heading mw-heading3"><h3 id="Comment_out">Comment out</h3></div>
<p>
</p><p>A common developer practice is to <b>comment out</b> one or more lines of code. The programmer adds comment syntax that converts program code into comments so that what was executable code will no longer be executed at runtime. Sometimes this technique is used to find the cause of a bug. By systematically commenting out and running parts of the program, the offending source code can be located.
</p><p>Many IDEs support adding and removing comments with convenient <a href="User_interface" title="User interface">user interface</a> such as a <a href="Keyboard_shortcut" title="Keyboard shortcut">keyboard shortcut</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Store_metadata">Store metadata</h3></div>
<p>Comments can store <a href="Metadata" title="Metadata">metadata</a> about the code. Common metadata includes the name of the original author and subsequent maintainers, dates when first written and modified, link to development and user documentation, and legal information such as <a href="Copyright" title="Copyright">copyright</a> and <a href="Software_license" title="Software license">software license</a>.
</p><p>Some <a href="Programming_tools" class="mw-redirect" title="Programming tools">programming tools</a> write metadata into the code as comments.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> For example, a <a href="Version_control" title="Version control">version control</a> tool might write metadata such as author, date and version number into each file when it's committed to the repository.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Integrate_with_development_tools">Integrate with development tools</h3></div>
<p>Sometimes information stored in comments is used by development tools other than the translator – the primary tool that consumes the code. This information may include metadata (often used by a documentation generator) or tool configuration.
</p><p>Some <a href="Source_code_editor" class="mw-redirect" title="Source code editor">source code editors</a> support configuration via metadata in comments.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> One particular example is the <i>modeline</i> feature of <a href="Vim_(text_editor)" title="Vim (text editor)">Vim</a> which configures tab character handling. For example:
</p>
<pre># vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
</pre>
<div class="mw-heading mw-heading3"><h3 id="Support_documentation_generation">Support documentation generation</h3></div>
<p>An <a href="API" title="API">API</a> <a href="Documentation_generator" title="Documentation generator">documentation generator</a> parses information from a codebase to generate API documentation. Many support reading information from comments, often parsing metadata, to control the content and formatting of the resulting document.
</p><p>Although some claim that API documentation can be higher quality when written in a more traditional and manual way, some claim that storing documentation information in code comments simplifies the documenting process, as well as increases the likelihood that the documentation will be kept up to date.<sup id="cite_ref-Ambler000_15-0" class="reference"><a href="#cite_note-Ambler000-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> Examples include <a href="Javadoc" title="Javadoc">Javadoc</a>, Ddoc, <a href="Doxygen" title="Doxygen">Doxygen</a>, <a href="Visual_Expert" title="Visual Expert">Visual Expert</a> and <a href="PHPDoc" title="PHPDoc">PHPDoc</a>. Forms of <a href="Docstring" title="Docstring">docstring</a> are supported by <a href="Python_(programming_language)" title="Python (programming language)">Python</a>, <a href="Lisp_(programming_language)" title="Lisp (programming language)">Lisp</a>, <a href="Elixir_(programming_language)" title="Elixir (programming language)">Elixir</a>, and <a href="Clojure" title="Clojure">Clojure</a>.<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> <a href="C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a>, <a href="F_Sharp_(programming_language)" title="F Sharp (programming language)">F#</a> and <a href="Visual_Basic_.NET" class="mw-redirect" title="Visual Basic .NET">Visual Basic .NET</a> implement a similar feature called "XML Comments" which are read by <a href="IntelliSense" class="mw-redirect" title="IntelliSense">IntelliSense</a> from the compiled <a href=".NET" title=".NET">.NET</a> assembly.<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Visualization">Visualization</h3></div>
<p>An <a href="ASCII_art" title="ASCII art">ASCII art</a> <a href="Data_and_information_visualization" title="Data and information visualization">visualization</a> such as a <a href="Logo" title="Logo">logo</a>, diagram, or <a href="Flowchart" title="Flowchart">flowchart</a> can be included in a comment.<sup id="cite_ref-asciiart000_18-0" class="reference"><a href="#cite_note-asciiart000-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup>
</p><p>The following code fragment depicts the process flow of a <a href="System_administration" class="mw-redirect" title="System administration">system administration</a> script (<a href="Windows_Script_File" title="Windows Script File">Windows script file</a>). Although a section marking the code appears as a comment, the diagram is in an <a href="XML" title="XML">XML</a> <a href="CDATA" title="CDATA">CDATA</a> section, which is technically not a comment, but serves the same purpose here.<sup id="cite_ref-Niederst000_19-0" class="reference"><a href="#cite_note-Niederst000-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup> Although this diagram could be in a comment, the example illustrates one instance where the programmer opted not to use a comment as a way of including resources in source code.<sup id="cite_ref-Niederst000_19-1" class="reference"><a href="#cite_note-Niederst000-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span class="cm">&lt;!-- begin: wsf_resource_nodes --&gt;</span>
<span class="nt">&lt;resource</span><span class="w"> </span><span class="na">id=</span><span class="s">"ProcessDiagram000"</span><span class="nt">&gt;</span>
<span class="cp">&lt;![CDATA[</span>
<span class="cp"> HostApp (Main_process)</span>
<span class="cp"> |</span>
<span class="cp"> V</span>
<span class="cp">script.wsf (app_cmd) --&gt; ClientApp (async_run, batch_process)</span>
<span class="cp"> |</span>
<span class="cp"> |</span>
<span class="cp"> V</span>
<span class="cp"> mru.ini (mru_history) </span>
<span class="cp">]]&gt;</span>
<span class="nt">&lt;/resource&gt;</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Store_resource_data">Store resource data</h3></div>
<p>
Binary data may also be encoded in comments through a process known as <a href="Binary-to-text_encoding" title="Binary-to-text encoding">binary-to-text encoding</a>, although such practice is uncommon and typically relegated to external resource files.
</p>
<div class="mw-heading mw-heading3"><h3 id="Document_development_process">Document development process</h3></div>
<p>Sometimes, comments describe development processes related to the code. For example, comments might describe how to <a href="Software_build" title="Software build">build</a> the code or how to submit changes to the <a href="Software_maintainer" title="Software maintainer">software maintainer</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Extend_language_syntax">Extend language syntax</h3></div>
<p>Occasionally, code that is formatted as a comment is overloaded to convey additional information to the translator, such as conditional comments. As such, syntax that generally indicates a comment can actually represent program code; not comment code. Such syntax may be a practical way to maintain compatibility while adding additional functionality, but some regard such a solution as a <a href="Kludge" title="Kludge">kludge</a>.<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup>
</p><p>Other examples include interpreter <a href="Directive_(programming)" title="Directive (programming)">directives</a>:
</p>
<ul><li>The Unix "<a href="Shebang_(Unix)" title="Shebang (Unix)">shebang</a>" – <code>#!</code> – used on the first line of a script to point to the interpreter to be used.</li>
<li>"Magic comments" identifying the encoding a source file is using,<sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup> e.g. Python's PEP 263.<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup></li></ul>
<p>The script below for a Unix-like system shows both of these uses:
</p>
<div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span class="ch">#!/usr/bin/env python3</span>
<span class="c1"># -*- coding: UTF-8 -*-</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"Testing"</span><span class="p">)</span>
</pre></div>
<p>The <a href="GNU_Compiler_Collection" title="GNU Compiler Collection">gcc</a> compiler (since 2017) looks for a comment in a <a href="Switch_statement" title="Switch statement">switch statement</a> if a case falls-thru to the next case. If an explicit indication of fall-thru is not found, then the compiler issues a warning about a possible coding problem. Inserting such a comment about fall-thru is a long standing convention, and the compiler has codified the practice.<sup id="cite_ref-23" class="reference"><a href="#cite_note-23"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> For example:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span class="k">switch</span><span class="w"> </span><span class="p">(</span><span class="n">command</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="n">CMD_SHOW_HELP_AND_EXIT</span><span class="p">:</span>
<span class="w"> </span><span class="n">do_show_help</span><span class="p">();</span>
<span class="w"> </span><span class="cm">/* Fall thru */</span>
<span class="w"> </span><span class="k">case</span><span class="w"> </span><span class="n">CMD_EXIT</span><span class="p">:</span>
<span class="w"> </span><span class="n">do_exit</span><span class="p">();</span>
<span class="w"> </span><span class="k">break</span><span class="p">;</span>
<span class="w"> </span><span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Relieve_stress">Relieve stress</h3></div>
<p>To relieve stress or attempt humor, sometimes programmers add comments about the quality of the code, tools, competitors, employers, working conditions, or other arguably unprofessional topics – sometimes using <a href="Profanity" title="Profanity">profanity</a>.<sup id="cite_ref-24" class="reference"><a href="#cite_note-24"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-SwearWords_25-0" class="reference"><a href="#cite_note-SwearWords-25"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Normative_views">Normative views</h2></div>
<p>There are various normative views and long-standing opinions regarding the proper use of comments in source code.<sup id="cite_ref-26" class="reference"><a href="#cite_note-26"><span class="cite-bracket">[</span>26<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-27" class="reference"><a href="#cite_note-27"><span class="cite-bracket">[</span>27<span class="cite-bracket">]</span></a></sup> Some of these are informal and based on personal preference, while others are published or promulgated as formal guidelines for a particular community.<sup id="cite_ref-28" class="reference"><a href="#cite_note-28"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Need_for_comments">Need for comments</h3></div>
<p>Experts have varying viewpoints on whether, and when, comments are appropriate in source code.<sup id="cite_ref-BadComment000_9-1" class="reference"><a href="#cite_note-BadComment000-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-BadComments001_29-0" class="reference"><a href="#cite_note-BadComments001-29"><span class="cite-bracket">[</span>29<span class="cite-bracket">]</span></a></sup> Some assert that source code should be written with few comments, on the basis that the source code should be self-explanatory or <a href="Self-documenting" class="mw-redirect" title="Self-documenting">self-documenting</a>.<sup id="cite_ref-BadComment000_9-2" class="reference"><a href="#cite_note-BadComment000-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup> Others suggest code should be extensively commented (it is not uncommon for over 50% of the non-<a href="Whitespace_(computer_science)" class="mw-redirect" title="Whitespace (computer science)">whitespace</a> characters in source code to be contained within comments).<sup id="cite_ref-Morelli000_30-0" class="reference"><a href="#cite_note-Morelli000-30"><span class="cite-bracket">[</span>30<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Javadoc000_31-0" class="reference"><a href="#cite_note-Javadoc000-31"><span class="cite-bracket">[</span>31<span class="cite-bracket">]</span></a></sup>
</p><p>In between these views is the assertion that comments are neither beneficial nor harmful by themselves, and what matters is that they are correct and kept in sync with the source code, and omitted if they are superfluous, excessive, difficult to maintain or otherwise unhelpful.<sup id="cite_ref-techniques001_32-0" class="reference"><a href="#cite_note-techniques001-32"><span class="cite-bracket">[</span>32<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-CmmtPhilosophy_33-0" class="reference"><a href="#cite_note-CmmtPhilosophy-33"><span class="cite-bracket">[</span>33<span class="cite-bracket">]</span></a></sup>
</p><p>Comments are sometimes used to document contracts in the <a href="Design_by_contract" title="Design by contract">design by contract</a> approach to programming.
</p>
<div class="mw-heading mw-heading3"><h3 id="Level_of_detail">Level of detail</h3></div>
<p>Depending on the intended audience of the code and other considerations, the level of detail and description may vary considerably.
</p><p>For example, the following Java comment would be suitable in an introductory text designed to teach beginning programming:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="n">String</span><span class="w"> </span><span class="n">s</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"Wikipedia"</span><span class="p">;</span><span class="w"> </span><span class="cm">/* Assigns the value "Wikipedia" to the variable s. */</span>
</pre></div>
<p>This level of detail, however, would not be appropriate in the context of production code, or other situations involving experienced developers. Such rudimentary descriptions are inconsistent with the guideline: "Good comments ... clarify intent."<sup id="cite_ref-GoodComment000_10-1" class="reference"><a href="#cite_note-GoodComment000-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> Further, for professional coding environments, the level of detail is ordinarily well defined to meet a specific performance requirement defined by business operations.<sup id="cite_ref-Javadoc000_31-1" class="reference"><a href="#cite_note-Javadoc000-31"><span class="cite-bracket">[</span>31<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Styles">Styles</h2></div>
<p>As free-form text, comments can be styled in a wide variety of ways. Many prefer a style that is consistent, non-obstructive, easy to modify, and difficult to break. As some claim that a level of consistency is valuable and worthwhile, a consistent commenting style is sometimes agreed upon before a project starts or emerges as development progresses.<sup id="cite_ref-gnome000_34-0" class="reference"><a href="#cite_note-gnome000-34"><span class="cite-bracket">[</span>34<span class="cite-bracket">]</span></a></sup>
</p><p>The following C fragments show some of diversity in block comment style:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="cm">/*</span>
<span class="cm"> This is the comment body.</span>
<span class="cm">*/</span>
</pre></div>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="cm">/*****************************</span>
<span class="cm"> * *</span>
<span class="cm"> * This is the comment body. *</span>
<span class="cm"> * *</span>
<span class="cm"> *****************************/</span>
</pre></div>
<p>Factors such as personal preference, flexibility of programming tools can influence the commenting style used. For example, the first might be preferred by programmers who use a <a href="Source_code_editor" class="mw-redirect" title="Source code editor">source code editor</a> that does not automatically format a comment as shown in the second example.
</p><p>Software consultant and technology commentator <a href="Allen_Holub" title="Allen Holub">Allen Holub</a><sup id="cite_ref-Holub000_35-0" class="reference"><a href="#cite_note-Holub000-35"><span class="cite-bracket">[</span>35<span class="cite-bracket">]</span></a></sup> advocates aligning the left edges of comments:<sup id="cite_ref-Holub001_36-0" class="reference"><a href="#cite_note-Holub001-36"><span class="cite-bracket">[</span>36<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="w"> </span><span class="cm">/* This is the style recommended by Holub for C and C++.</span>
<span class="cm"> * It is demonstrated in ''Enough Rope'', in rule 29.</span>
<span class="cm"> */</span>
</pre></div>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="w"> </span><span class="cm">/* This is another way to do it, also in C.</span>
<span class="cm"> ** It is easier to do in editors that do not automatically indent the second</span>
<span class="cm"> ** through last lines of the comment one space from the first.</span>
<span class="cm"> ** It is also used in Holub's book, in rule 31.</span>
<span class="cm"> */</span>
</pre></div>
<p>In many languages, a line comment can follow program code such that the comment is <i>inline</i> and generally describes the code to the left of it. For example, in this Perl:
</p>
<div class="mw-highlight mw-highlight-lang-perl mw-content-ltr" dir="ltr"><pre><span class="k">print</span><span class="w"> </span><span class="nv">$s</span><span class="w"> </span><span class="o">.</span><span class="w"> </span><span class="s">"\n"</span><span class="p">;</span><span class="w"> </span><span class="c1"># Add a newline character after printing</span>
</pre></div>
<p>If a language supports both line and block comments, programming teams may decide upon a convention of when to use which. For example, line comments only for minor comments, and block comments to for higher-level abstractions.
</p>
<div class="mw-heading mw-heading2"><h2 id="Tags">Tags</h2></div>
<p>Programmers often use one of select words – also known as <a href="Tag_(metadata)" title="Tag (metadata)">tags</a>, codetags<sup id="cite_ref-37" class="reference"><a href="#cite_note-37"><span class="cite-bracket">[</span>37<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-38" class="reference"><a href="#cite_note-38"><span class="cite-bracket">[</span>38<span class="cite-bracket">]</span></a></sup> and tokens<sup id="cite_ref-39" class="reference"><a href="#cite_note-39"><span class="cite-bracket">[</span>39<span class="cite-bracket">]</span></a></sup> – to categorize the information in a comment. Programmers may leverage these tags by searching for them via a <a href="Text_editor" title="Text editor">text editor</a> or <a href="Grep" title="Grep">grep</a>. Some editors <a href="Syntax_highlighting" title="Syntax highlighting">highlight</a> comment text based on tags.
</p><p>Commonly used tags include:
</p>
<ul><li>BUG, DEBUG — identifies a known <a href="Software_bug" title="Software bug">bug</a>; maybe implying it should be fixed</li>
<li>FIXME — implies that there is work to do to fix a bug</li>
<li>HACK, BODGE, KLUDGE — marks a solution that might be considered low quality</li>
<li>TODO — describes some work to do</li>
<li>NOTE — relatively general information</li>
<li>UNDONE — a reversal or "roll back" of previous code</li></ul>
<p>For example:
</p>
<pre>int foo() {
// TODO implement
}
</pre>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<p>Syntax for comments varies by programming language. There are common patterns used by multiple languages while also a wide range of syntax among the languages in general. To limit the length of this section, some examples are grouped by languages with the same or very similar syntax. Others are for particular languages that have less common syntax.
</p>
<div class="mw-heading mw-heading3"><h3 id="Curly_brace_languages">Curly brace languages</h3></div>
<p>Many of the <a href="Curly_brace_language" class="mw-redirect" title="Curly brace language">curly brace languages</a> such as C, C++ and their many derivatives delimit a line comment with <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">//</code> and a block comment with <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">/*</code> and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">*/</code>. Originally, C lacked the line comment, but it was added in <a href="C99" title="C99">C99</a>. Notable languages include: C, C++, <a href="C#_(programming_language)" title="C">C#</a>, <a href="D_(programming_language)" title="D (programming language)">D</a>, <a href="Java_(programming_language)" title="Java (programming language)">Java</a>, <a href="JavaScript" title="JavaScript">JavaScript</a> and <a href="Swift_(programming_language)" title="Swift (programming language)">Swift</a>. For example:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="cm">/*</span>
<span class="cm"> * Check if over maximum process limit, but be sure to exclude root.</span>
<span class="cm"> * This is needed to make it possible for login to set per-user</span>
<span class="cm"> * process limit to something lower than processes root is running.</span>
<span class="cm"> */</span>
<span class="kt">bool</span><span class="w"> </span><span class="nf">isOverMaximumProcessLimit</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// TODO implement</span>
<span class="p">}</span>
</pre></div>
<p>Some languages, including D and Swift, allow blocks to be nested while other do not, including C and C++.
</p><p>An example of nested blocks in D:
</p>
<div class="mw-highlight mw-highlight-lang-d mw-content-ltr" dir="ltr"><pre><span class="c1">// line comment</span>
<span class="cm">/* </span>
<span class="cm"> block comment</span>
<span class="cm">*/</span>
<span class="cm">/+ start of outer block</span>
<span class="cm"> /+ inner block +/</span>
<span class="cm"> end of outer block +/</span>
</pre></div>
<p>An example of nested blocks in Swift:
</p>
<div class="mw-highlight mw-highlight-lang-swift mw-content-ltr" dir="ltr"><pre><span class="cm">/* This is the start of the outer comment.</span>
<span class="cm"> /* This is the nested comment. */</span>
<span class="cm">This is the end of the outer comment. */</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Scripting">Scripting</h3></div>
<p>A pattern in many <a href="Scripting_language" title="Scripting language">scripting languages</a> is to delimit a line comment with <code>#</code>. Support for a block comment varies. Notable languages include: <a href="Bash_(Unix_shell)" title="Bash (Unix shell)">Bash</a>, <a href="Raku_(programming_language)" title="Raku (programming language)">Raku</a>, <a href="Ruby_(programming_language)" title="Ruby (programming language)">Ruby</a>, <a href="Perl" title="Perl">Perl</a>, <a href="Windows_PowerShell" class="mw-redirect" title="Windows PowerShell">PowerShell</a>, <a href="Python_(programming_language)" title="Python (programming language)">Python</a> and <a href="R_(programming_language)" title="R (programming language)">R</a>.
</p><p>An example in R:
</p>
<div class="mw-highlight mw-highlight-lang-r mw-content-ltr" dir="ltr"><pre><span class="c1"># This is a comment</span>
<span class="nf">print</span><span class="p">(</span><span class="s">"This is not a comment"</span><span class="p">)</span><span class="w"> </span><span class="c1"># This is another comment</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_Ruby">Block in Ruby</h4></div>
<p>A block comment is delimited by <code>=begin</code> and <code>=end</code> that start a line. For example:
</p>
<div class="mw-highlight mw-highlight-lang-ruby mw-content-ltr" dir="ltr"><pre><span class="nb">puts</span><span class="w"> </span><span class="s2">"not a comment"</span>
<span class="c1"># this is a comment</span>
<span class="nb">puts</span><span class="w"> </span><span class="s2">"not a comment"</span>
<span class="cm">=begin</span>
<span class="cm">whatever goes in these lines</span>
<span class="cm">is just for the human reader</span>
<span class="cm">=end</span>
<span class="nb">puts</span><span class="w"> </span><span class="s2">"not a comment"</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_Perl">Block in Perl</h4></div>
<p>Instead of a regular block commenting construct, Perl uses <a href="Literate_programming" title="Literate programming">literate programming</a> <a href="Plain_Old_Documentation" title="Plain Old Documentation">plain old documentation (POD)</a> markup.<sup id="cite_ref-40" class="reference"><a href="#cite_note-40"><span class="cite-bracket">[</span>40<span class="cite-bracket">]</span></a></sup> For example:<sup id="cite_ref-41" class="reference"><a href="#cite_note-41"><span class="cite-bracket">[</span>41<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-perl mw-content-ltr" dir="ltr"><pre><span class="cm">=item Pod::List-E&lt;gt&gt;new()</span>
<span class="cm">Create a new list object. Properties may be specified through a hash</span>
<span class="cm">reference like this:</span>
<span class="cm"> my $list = Pod::List-&gt;new({ -start =&gt; $., -indent =&gt; 4 });</span>
<span class="cm">=cut</span>
<span class="k">sub</span><span class="w"> </span><span class="nf">new</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="o">...</span>
<span class="p">}</span>
</pre></div>
<p>Raku (previously called Perl 6) uses the same line comments and POD comments as <a href="Perl" title="Perl">Perl</a>, but adds a configurable block comment type: "multi-line / embedded comments".<sup id="cite_ref-perl6_42-0" class="reference"><a href="#cite_note-perl6-42"><span class="cite-bracket">[</span>42<span class="cite-bracket">]</span></a></sup> It starts with <code>#`</code> and then an opening bracket character and ends with the matching closing bracket character.<sup id="cite_ref-perl6_42-1" class="reference"><a href="#cite_note-perl6-42"><span class="cite-bracket">[</span>42<span class="cite-bracket">]</span></a></sup> For example:
</p>
<div class="mw-highlight mw-highlight-lang-perl6 mw-content-ltr" dir="ltr"><pre><span class="cm">#`{{ "commenting out" this version </span>
<span class="cm">toggle-case(Str:D $s)</span>
<span class="cm">Toggles the case of each character in a string:</span>
<span class="cm"> my Str $toggled-string = toggle-case("mY NAME IS mICHAEL!");</span>
<span class="cm">}}</span>
<span class="k">sub</span> <span class="n">toggle-case</span>(<span class="nb">Str:D</span> <span class="nv">$s</span>) <span class="cm">#`( this version of parens is used now )</span>{
...
}
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_PowerShell">Block in PowerShell</h4></div>
<p>PowerShell supports a block comment delimited by <code>&lt;#</code> and <code>#&gt;</code>. For example:
</p>
<div class="mw-highlight mw-highlight-lang-powershell mw-content-ltr" dir="ltr"><pre><span class="c"># Single line comment</span>
<span class="cm">&lt;# Multi</span>
<span class="cm"> Line</span>
<span class="cm"> Comment #&gt;</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_Python">Block in Python</h4></div>
<p>Although Python does not provide for block comments<sup id="cite_ref-triple_43-0" class="reference"><a href="#cite_note-triple-43"><span class="cite-bracket">[</span>43<span class="cite-bracket">]</span></a></sup> a bare <a href="String_literal" title="String literal">string literal</a> represented by a triple-quoted string is often used for this purpose.<sup id="cite_ref-44" class="reference"><a href="#cite_note-44"><span class="cite-bracket">[</span>44<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-triple_43-1" class="reference"><a href="#cite_note-triple-43"><span class="cite-bracket">[</span>43<span class="cite-bracket">]</span></a></sup> In the examples below, the triple double-quoted strings act like comments, but are also treated as <a href="Docstring" title="Docstring">docstrings</a>:
</p>
<div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span class="sd">"""</span>
<span class="sd">At the top of a file, this is the module docstring</span>
<span class="sd">"""</span>

<span class="k">class</span><span class="w"> </span><span class="nc">MyClass</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Class docstring"""</span>

<span class="k">def</span><span class="w"> </span><span class="nf">my_method</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">"""Method docstring"""</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Browser_markup">Browser markup</h3></div>
<p>Markup languages in general vary in comment syntax, but some of the notable internet markup formats such as <a href="HTML" title="HTML">HTML</a> and <a href="XML" title="XML">XML</a> delimit a block comment with <code>&lt;!--</code> and <code>--&gt;</code> and provide no line comment support. An example in XML:
</p>
<div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span class="cm">&lt;!-- select the context here --&gt;</span>
<span class="nt">&lt;param</span><span class="w"> </span><span class="na">name=</span><span class="s">"context"</span><span class="w"> </span><span class="na">value=</span><span class="s">"public"</span><span class="w"> </span><span class="nt">/&gt;</span>
</pre></div>
<p>For compatibility with <a href="SGML" class="mw-redirect" title="SGML">SGML</a>, double-hyphen (--) is not allowed inside comments.
</p><p><a href="ColdFusion" class="mw-redirect" title="ColdFusion">ColdFusion</a> provides syntax similar to the <a href="HTML_comment" class="mw-redirect" title="HTML comment">HTML comment</a>, but uses three dashes instead of two. CodeFusion allows for nested block comments.
</p>
<div class="mw-heading mw-heading3"><h3 id="Double_dash">Double dash</h3></div>
<p>A relatively loose collection of languages use <code>--</code> for a single line comment. Notable languages include: <a href="Ada_(programming_language)" title="Ada (programming language)">Ada</a>, <a href="Eiffel_(programming_language)" title="Eiffel (programming language)">Eiffel</a>, <a href="Haskell_(programming_language)" class="mw-redirect" title="Haskell (programming language)">Haskell</a>, <a href="Lua_(programming_language)" class="mw-redirect" title="Lua (programming language)">Lua</a>, <a href="SQL" title="SQL">SQL</a> and <a href="VHDL" title="VHDL">VHDL</a>. Block comment support varies. An example in Ada:
</p>
<div class="mw-highlight mw-highlight-lang-ada mw-content-ltr" dir="ltr"><pre><span class="c1">-- the air traffic controller task takes requests for takeoff and landing</span>
<span class="kd">task</span> <span class="kd">type</span> <span class="kt">Controller</span> <span class="p">(</span><span class="nv">My_Runway</span><span class="p">: </span><span class="nv">Runway_Access</span><span class="p">)</span> <span class="kr">is</span>
<span class="c1">-- task entries for synchronous message passing</span>
<span class="kd">entry</span> <span class="nf">Request_Takeoff</span> <span class="p">(</span><span class="nv">ID</span><span class="p">: </span><span class="nv">in</span> <span class="nv">Airplane_ID</span><span class="p">;</span> <span class="nv">Takeoff</span><span class="p">: </span><span class="nv">out</span> <span class="nv">Runway_Access</span><span class="p">);</span>
<span class="kd">entry</span> <span class="nf">Request_Approach</span><span class="p">(</span><span class="nv">ID</span><span class="p">: </span><span class="nv">in</span> <span class="nv">Airplane_ID</span><span class="p">;</span> <span class="nv">Approach</span><span class="p">: </span><span class="nv">out</span> <span class="nv">Runway_Access</span><span class="p">);</span>
<span class="kr">end</span> <span class="nf">Controller</span><span class="p">;</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_Haskell">Block in Haskell</h4></div>
<p>In Haskell, a block comment is delimited by <code>{-</code> and <code>-}</code>. For example:
</p>
<div class="mw-highlight mw-highlight-lang-haskell mw-content-ltr" dir="ltr"><pre><span class="cm">{- this is a comment</span>
<span class="cm">on more lines -}</span>
<span class="c1">-- and this is a comment on one line</span>
<span class="nf">putStrLn</span><span class="w"> </span><span class="s">"Wikipedia"</span><span class="w"> </span><span class="c1">-- this is another comment</span>
</pre></div>
<p>Haskell also provides a <a href="Literate_programming" title="Literate programming">literate programming</a> method of commenting known as "Bird Style".<sup id="cite_ref-45" class="reference"><a href="#cite_note-45"><span class="cite-bracket">[</span>45<span class="cite-bracket">]</span></a></sup> Lines starting with <code>&gt;</code> are interpreted as code and everything else is considered a comment. One additional requirement is a blank line before and after the code block:
</p>
<div class="mw-highlight mw-highlight-lang-lhaskell mw-content-ltr" dir="ltr"><pre>In Bird-style you have to leave a blank before the code.

<span class="cs">&gt; </span><span class="nf">fact</span><span class="w"> </span><span class="ow">::</span><span class="w"> </span><span class="kt">Integer</span><span class="w"> </span><span class="ow">-&gt;</span><span class="w"> </span><span class="kt">Integer</span>
<span class="cs">&gt; </span><span class="nf">fact</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="mi">1</span>
<span class="cs">&gt; </span><span class="nf">fact</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">fact</span><span class="w"> </span><span class="n">n</span>

And you have to leave a blank line after the code as well.
</pre></div>
<p>Literate programming can also be accomplished via <a href="LaTeX" title="LaTeX">LaTeX</a>. Example of a definition:
</p>
<div class="mw-highlight mw-highlight-lang-lhaskell mw-content-ltr" dir="ltr"><pre><span class="k">\usepackage</span><span class="nb">{</span>verbatim<span class="nb">}</span>
<span class="k">\newenvironment</span><span class="nb">{</span>code<span class="nb">}{</span><span class="k">\verbatim</span><span class="nb">}{</span><span class="k">\endverbatim</span><span class="nb">}</span>
</pre></div>
<p>Used as follows:
</p>
<div class="mw-highlight mw-highlight-lang-lhaskell mw-content-ltr" dir="ltr"><pre><span class="c">% the LaTeX source file</span>
The <span class="k">\verb</span>|fact n| function call computes <span class="s">$</span><span class="nb">n</span><span class="o">!</span><span class="s">$</span> if <span class="s">$</span><span class="nb">n</span><span class="nv">\ge</span><span class="nb"> </span><span class="m">0</span><span class="s">$</span>, here is a definition:<span class="k">\\</span>
<span class="k">\begin</span><span class="nb">{</span>code<span class="nb">}</span>
<span class="nf">fact</span><span class="w"> </span><span class="ow">::</span><span class="w"> </span><span class="kt">Integer</span><span class="w"> </span><span class="ow">-&gt;</span><span class="w"> </span><span class="kt">Integer</span>
<span class="nf">fact</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="mi">1</span>
<span class="nf">fact</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="ow">=</span><span class="w"> </span><span class="p">(</span><span class="n">n</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">fact</span><span class="w"> </span><span class="n">n</span>
<span class="k">\end</span><span class="nb">{</span>code<span class="nb">}</span>
Here more explanation using <span class="k">\LaTeX</span><span class="nb">{}</span> markup
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_Lua">Block in Lua</h4></div>
<p>Lua supports block comments delimited by <code>--[[</code> and <code>]]</code><sup id="cite_ref-46" class="reference"><a href="#cite_note-46"><span class="cite-bracket">[</span>46<span class="cite-bracket">]</span></a></sup> For example:
</p>
<div class="mw-highlight mw-highlight-lang-lua mw-content-ltr" dir="ltr"><pre><span class="cm">--[[A multi-line</span>
<span class="cm">long comment</span>
<span class="cm">]]</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Block_in_SQL">Block in SQL</h4></div>
<p>In some variants of SQL, the curly brace language block comment (<code>/**/</code>) is supported. Variants include: <a href="Transact-SQL" title="Transact-SQL">Transact-SQL</a>, <a href="MySQL" title="MySQL">MySQL</a>, <a href="SQLite" title="SQLite">SQLite</a>, <a href="PostgreSQL" title="PostgreSQL">PostgreSQL</a>, and <a href="Oracle_Database" title="Oracle Database">Oracle</a>.<sup id="cite_ref-MSSQL_47-0" class="reference"><a href="#cite_note-MSSQL-47"><span class="cite-bracket">[</span>47<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-MySQL_48-0" class="reference"><a href="#cite_note-MySQL-48"><span class="cite-bracket">[</span>48<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-SQLite_49-0" class="reference"><a href="#cite_note-SQLite-49"><span class="cite-bracket">[</span>49<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-PostgreSQL_50-0" class="reference"><a href="#cite_note-PostgreSQL-50"><span class="cite-bracket">[</span>50<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-Oracle_51-0" class="reference"><a href="#cite_note-Oracle-51"><span class="cite-bracket">[</span>51<span class="cite-bracket">]</span></a></sup>
</p><p>MySQL also supports a line comment delimited by <code>#</code>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Less_common_syntax">Less common syntax</h3></div>
<div class="mw-heading mw-heading4"><h4 id="APL">APL</h4></div>
<p><a href="APL_(programming_language)" title="APL (programming language)">APL</a> uses <code>⍝</code> ("lamp") for a line comment. For example:
</p>
<div class="mw-highlight mw-highlight-lang-apl mw-content-ltr" dir="ltr"><pre><span class="c1">⍝ Now add the numbers:</span>
<span class="nv">c</span><span class="kd">←</span><span class="nv">a</span><span class="o">+</span><span class="nv">b</span><span class="w"> </span><span class="c1">⍝ addition</span>
</pre></div>
<p>In dialects that have the <code>⊣</code> ("left") and <code>⊢</code> ("right") primitives, comments can often be <i>inside</i> or separate statements, in the form of ignored strings:
</p>
<div class="mw-highlight mw-highlight-lang-apl mw-content-ltr" dir="ltr"><pre><span class="nv">d</span><span class="kd">←</span><span class="m">2</span><span class="o">×</span><span class="nv">c</span><span class="w"> </span><span class="o">⊣</span><span class="s1">'where'</span><span class="o">⊢</span><span class="w"> </span><span class="nv">c</span><span class="kd">←</span><span class="nv">a</span><span class="o">+</span><span class="w"> </span><span class="s1">'bound'</span><span class="o">⊢</span><span class="w"> </span><span class="nv">b</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="AppleScript">AppleScript</h4></div>
<p><a href="AppleScript" title="AppleScript">AppleScript</a> supports both line and block comments. For example:
</p>
<div class="mw-highlight mw-highlight-lang-applescript mw-content-ltr" dir="ltr"><pre><span class="c"># line comment (in later versions)</span>
<span class="cm">(*</span>
<span class="cm">This program displays a greeting.</span>
<span class="cm">*)</span>
<span class="k">on</span> <span class="nv">greet</span><span class="p">(</span><span class="nv">myGreeting</span><span class="p">)</span>
<span class="nb">display dialog</span> <span class="nv">myGreeting</span> <span class="o">&amp;</span> <span class="s2">" world!"</span>
<span class="k">end</span> <span class="nv">greet</span>

<span class="c">-- Show the greeting</span>
<span class="nv">greet</span><span class="p">(</span><span class="s2">"Hello"</span><span class="p">)</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="BASIC">BASIC</h4></div>
<p>Early versions of <a href="BASIC" title="BASIC">BASIC</a> used <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">REM</code> (short for remark) for a line comment.
</p>
<div class="mw-highlight mw-highlight-lang-basic mw-content-ltr" dir="ltr"><pre><span class="nl">10</span><span class="w"> </span><span class="c1">REM This BASIC program shows the use of the PRINT and GOTO Statements.</span>
<span class="nl">15</span><span class="w"> </span><span class="c1">REM It fills the screen with the phrase "HELLO"</span>
<span class="nl">20</span><span class="w"> </span><span class="kr">PRINT</span><span class="w"> </span><span class="s2">"HELLO"</span>
<span class="nl">30</span><span class="w"> </span><span class="kr">GOTO</span><span class="w"> </span><span class="nl">20</span>
</pre></div>
<p>In later variations, including <a href="Quick_Basic" class="mw-redirect" title="Quick Basic">Quick Basic</a>, <a href="Q_Basic" class="mw-redirect" title="Q Basic">Q Basic</a>, <a href="Visual_Basic" title="Visual Basic">Visual Basic</a> (VB), <a href="Visual_Basic_.NET" class="mw-redirect" title="Visual Basic .NET">VB.NET</a>, <a href="VBScript" title="VBScript">VBScript</a>, <a href="FreeBASIC" title="FreeBASIC">FreeBASIC</a> and <a href="Gambas" title="Gambas">Gambas</a>, a line comment is delimited with <code>'</code> (apostrophe). An example in VB.NET:
</p>
<div class="mw-highlight mw-highlight-lang-vbnet mw-content-ltr" dir="ltr"><pre><span class="k">Public</span><span class="w"> </span><span class="k">Class</span><span class="w"> </span><span class="nc">Form1</span>
<span class="w"> </span><span class="k">Private</span><span class="w"> </span><span class="k">Sub</span><span class="w"> </span><span class="nf">Button1_Click</span><span class="p">(</span><span class="n">sender</span><span class="w"> </span><span class="ow">As</span><span class="w"> </span><span class="kt">Object</span><span class="p">,</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="ow">As</span><span class="w"> </span><span class="n">EventArgs</span><span class="p">)</span><span class="w"> </span><span class="k">Handles</span><span class="w"> </span><span class="n">Button1</span><span class="p">.</span><span class="n">Click</span>
<span class="w"> </span><span class="c">' new style line comment</span>
<span class="w"> </span><span class="c">rem old style line comment still supported</span>
<span class="w"> </span><span class="n">MessageBox</span><span class="p">.</span><span class="n">Show</span><span class="p">(</span><span class="s">"Hello, World"</span><span class="p">)</span><span class="w"> </span><span class="c">' show dialog with a greeting</span>
<span class="w"> </span><span class="k">End</span><span class="w"> </span><span class="k">Sub</span>
<span class="k">End</span><span class="w"> </span><span class="k">Class</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Cisco_IOS_and_IOS-XE_configuration">Cisco IOS and IOS-XE configuration</h4></div>
<p>The <a href="Exclamation_point" class="mw-redirect" title="Exclamation point">exclamation point</a> (<b>!</b>) may be used to mark comments in a Cisco router's configuration mode, however such comments are <i>not</i> saved to <a href="Non-volatile_memory" title="Non-volatile memory">non-volatile memory</a> (which contains the startup-config), nor are they displayed by the "show run" command.<sup id="cite_ref-52" class="reference"><a href="#cite_note-52"><span class="cite-bracket">[</span>52<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-53" class="reference"><a href="#cite_note-53"><span class="cite-bracket">[</span>53<span class="cite-bracket">]</span></a></sup>
</p><p>It is possible to insert <a href="Human-readable" class="mw-redirect" title="Human-readable">human-readable</a> content that is actually part of the configuration, and may be saved to the <a href="NVRAM" class="mw-redirect" title="NVRAM">NVRAM</a> startup-config via:
</p>
<ul><li>The "description" command, used to add a description to the configuration of an interface or of a <a href="BGP" class="mw-redirect" title="BGP">BGP</a> neighbor</li>
<li>The "name" parameter, to add a remark to a static route</li>
<li>The "remark" command in access lists</li></ul>
<div class="mw-highlight mw-highlight-lang-text mw-content-ltr" dir="ltr"><pre>! Paste the text below to reroute traffic manually
config t
int gi0/2
no shut
ip route 0.0.0.0 0.0.0.0 gi0/2 name ISP2
no ip route 0.0.0.0 0.0.0.0 gi0/1 name ISP1
int gi0/1
shut
exit
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Fortran">Fortran</h4></div>
<p>The following fixed-form <a href="Fortran" title="Fortran">Fortran</a> code fragment shows that comment syntax is column-oriented. A letter <code>C</code> in the first column causes the entire line to be treated as a comment. In <a href="Fortran_77" class="mw-redirect" title="Fortran 77">Fortran 77</a>, an asterisk in column 1 also indicates a comment.
</p>
<div class="mw-highlight mw-highlight-lang-fortranfixed mw-content-ltr" dir="ltr"><pre><span class="c">C</span>
<span class="c">C Lines beginning with 'C' in the first (a.k.a. comment) column are comments</span>
<span class="c">C</span>
<span class="nl"> </span> <span class="k">WRITE</span><span class="w"> </span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="mi">610</span><span class="p">)</span>
<span class="nl"> 610</span> <span class="k">FORMAT</span><span class="p">(</span><span class="mi">12</span><span class="n">H</span><span class="w"> </span><span class="n">HELLO</span><span class="w"> </span><span class="n">WORLD</span><span class="p">)</span>
<span class="nl"> </span> <span class="k">END</span>
</pre></div>
<p>The following <a href="Fortran" title="Fortran">Fortran 90</a> code fragment shows a more modern line comment syntax; text following <code>!</code>.
</p>
<div class="mw-highlight mw-highlight-lang-fortran mw-content-ltr" dir="ltr"><pre><span class="c">! A comment</span>
<span class="k">program </span><span class="n">comment_test</span>
<span class="w"> </span><span class="k">print</span><span class="w"> </span><span class="s1">'(A)'</span><span class="p">,</span><span class="w"> </span><span class="s1">'Hello world'</span><span class="w"> </span><span class="c">! also a comment</span>
<span class="k">end program</span>
</pre></div>
<p>Free-form Fortran, also introduced with Fortran 90, only supports this latter style of comment.
</p><p>Although not a part of the Fortran Standard, many Fortran compilers offer an optional C-like <a href="Preprocessor" title="Preprocessor">preprocessor</a> pass. This can be used to provide block comments:
</p>
<div class="mw-highlight mw-highlight-lang-fortran mw-content-ltr" dir="ltr"><pre><span class="cp">#if 0</span>
<span class="w"> </span><span class="n">This</span><span class="w"> </span><span class="k">is </span><span class="n">a</span><span class="w"> </span><span class="k">block </span><span class="n">comment</span><span class="w"> </span><span class="n">spanning</span>
<span class="w"> </span><span class="n">multiple</span><span class="w"> </span><span class="n">lines</span><span class="p">.</span>
<span class="cp">#endif</span>
<span class="k">program </span><span class="n">comment_test</span>
<span class="w"> </span><span class="k">print</span><span class="w"> </span><span class="s1">'(A)'</span><span class="p">,</span><span class="w"> </span><span class="s1">'Hello world'</span><span class="w"> </span><span class="c">! also a comment</span>
<span class="k">end program</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="MATLAB">MATLAB</h4></div>
<p>In <a href="MATLAB" title="MATLAB">MATLAB</a>'s programming language, the '%' character indicates a single-line comment. Multi line comments are also available via&nbsp;%{ and&nbsp;%} brackets and can be nested, e.g.
</p>
<div class="mw-highlight mw-highlight-lang-matlab mw-content-ltr" dir="ltr"><pre><span class="c">% These are the derivatives for each term</span>
<span class="n">d</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">[</span><span class="mi">0</span><span class="w"> </span><span class="o">-</span><span class="mi">1</span><span class="w"> </span><span class="mi">0</span><span class="p">];</span>

<span class="cm">%{</span>
<span class="cm"> &nbsp;%{</span>
<span class="cm"> (Example of a nested comment, indentation is for cosmetics (and ignored).)</span>
<span class="cm"> &nbsp;%}</span>
<span class="w"> </span><span class="n">We</span><span class="w"> </span><span class="n">form</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">sequence</span><span class="p">,</span><span class="w"> </span><span class="n">following</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">Taylor</span><span class="w"> </span><span class="n">formula</span><span class="p">.</span>
<span class="w"> </span><span class="n">Note</span><span class="w"> </span><span class="n">that</span><span class="w"> </span><span class="n">we</span><span class="o">'</span><span class="n">re</span><span class="w"> </span><span class="n">operating</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">vector</span><span class="p">.</span>
<span class="c">%}</span>
<span class="n">seq</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">d</span><span class="w"> </span><span class="o">.*</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">c</span><span class="p">)</span><span class="o">.^</span><span class="n">n</span><span class="w"> </span><span class="o">./</span><span class="p">(</span><span class="nb">factorial</span><span class="p">(</span><span class="n">n</span><span class="p">))</span>

<span class="c">% We add-up to get the Taylor approximation</span>
<span class="n">approx</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">sum</span><span class="p">(</span><span class="n">seq</span><span class="p">)</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Nim">Nim</h4></div>
<p><a href="Nim_(programming_language)" title="Nim (programming language)">Nim</a> delimits a line comment with <code>#</code> and block comments with <code>#[</code> and <code>]#</code>. Block comments can be nested.
</p><p>Nim also has documentation comments that use mixed <a href="Markdown" title="Markdown">Markdown</a> and <a href="ReStructuredText" title="ReStructuredText">ReStructuredText</a> markups.
A line documentation comment uses '##' and a block documentation comment uses '##[' and ']##'.
The compiler can generate <a href="HTML" title="HTML">HTML</a>, <a href="LaTeX" title="LaTeX">LaTeX</a> and <a href="JSON" title="JSON">JSON</a> documentation from the documentation comments.
Documentation comments are part of the <a href="Abstract_syntax_tree" title="Abstract syntax tree">abstract syntax tree</a> and can be extracted using macros.<sup id="cite_ref-54" class="reference"><a href="#cite_note-54"><span class="cite-bracket">[</span>54<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-nim mw-content-ltr" dir="ltr"><pre><span class="sd">## Documentation of the module *ReSTructuredText* and **MarkDown**</span>
<span class="c"># This is a comment, but it is not a documentation comment.</span>

<span class="k">type</span><span class="w"> </span><span class="n">Kitten</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">object</span><span class="w"> </span><span class="sd">## Documentation of type</span>
<span class="w"> </span><span class="n">age</span><span class="p">:</span><span class="w"> </span><span class="nb">int</span><span class="w"> </span><span class="sd">## Documentation of field</span>

<span class="k">proc</span><span class="w"> </span><span class="nf">purr</span><span class="p">(</span><span class="n">self</span><span class="p">:</span><span class="w"> </span><span class="n">Kitten</span><span class="p">)</span><span class="w"> </span><span class="o">=</span>
<span class="w"> </span><span class="sd">## Documentation of function</span>
<span class="w"> </span><span class="n">echo</span><span class="w"> </span><span class="s">"Purr Purr"</span><span class="w"> </span><span class="c"># This is a comment, but it is not a documentation comment.</span>

<span class="c"># This is a comment, but it is not a documentation comment.</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="OCaml">OCaml</h4></div>
<p><a href="OCaml" title="OCaml">OCaml</a> supports nestable comments. For example:
</p>
<div class="mw-highlight mw-highlight-lang-ocaml mw-content-ltr" dir="ltr"><pre><span class="n">codeLine</span><span class="c">(* comment level 1(*comment level 2*)*)</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Pascal,_Delphi">Pascal, Delphi</h4></div>
<p>In <a href="Pascal_(programming_language)" title="Pascal (programming language)">Pascal</a> and <a href="Delphi_(software)" title="Delphi (software)">Delphi</a>, a block comment is delimited by <code>{</code> and <code>}</code>, and as an alternative for computers that do not support these characters, <code>(*</code> and <code>*)</code> are also supported. A line comment is delimited by <code>\\</code>.<sup id="cite_ref-55" class="reference"><a href="#cite_note-55"><span class="cite-bracket">[</span>55<span class="cite-bracket">]</span></a></sup> In <a href="Niklaus_Wirth" title="Niklaus Wirth">Niklaus Wirth</a>'s more modern family of languages (including <a href="Modula-2" title="Modula-2">Modula-2</a> and <a href="Oberon_(programming_language)" title="Oberon (programming language)">Oberon</a>), comments are delimited by <code>(*</code> and <code>*)</code>.<sup id="cite_ref-56" class="reference"><a href="#cite_note-56"><span class="cite-bracket">[</span>56<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-57" class="reference"><a href="#cite_note-57"><span class="cite-bracket">[</span>57<span class="cite-bracket">]</span></a></sup> Comments can be nested. For example:
</p>
<div class="mw-highlight mw-highlight-lang-pascal mw-content-ltr" dir="ltr"><pre><span class="cm">(* test diagonals *)</span>
<span class="n">columnDifference</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="n">testColumn</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">column</span><span class="o">;</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">row</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">columnDifference</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">testRow</span><span class="p">)</span><span class="w"> </span><span class="k">or</span>
<span class="w"> </span><span class="o">.......</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="PHP">PHP</h4></div>
<p>Comments in <a href="PHP" title="PHP">PHP</a> can be either curly brace style (both line and block), or line delimited with <code>#</code>l. Blocks cannot be nested. Starting in PHP 8, a <code>#</code> only means comment if it's not immediately followed by <code>[</code>. Otherwise, it delimits an attribute, which continues till the next <code>]</code>. For example:
</p>
<div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span class="sd">/**</span>
<span class="sd"> * This class contains a sample documentation.</span>
<span class="sd"> * @author Unknown</span>
<span class="sd"> */</span>
<span class="p">#[</span><span class="nd">Attribute</span><span class="p">]</span>
<span class="k">class</span> <span class="nc">MyAttribute</span> <span class="p">{</span>
<span class="k">const</span> <span class="no">VALUE</span> <span class="o">=</span> <span class="s1">'value'</span><span class="p">;</span>
<span class="c1">// C++ style line comment</span>
<span class="k">private</span> <span class="nv">$value</span><span class="p">;</span>
<span class="c1"># script style line comment</span>
<span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span><span class="p">(</span><span class="nv">$value</span> <span class="o">=</span> <span class="k">null</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$this</span><span class="o">-&gt;</span><span class="na">value</span> <span class="o">=</span> <span class="nv">$value</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Security_issues">Security issues</h2></div>
<p>In <a href="Interpreted_language" class="mw-redirect" title="Interpreted language">interpreted languages</a> the comments are viewable to the end user of the program. In some cases, such as sections of code that are "commented out", this may present a security <a href="Vulnerability_(computing)" class="mw-redirect" title="Vulnerability (computing)">vulnerability</a>.<sup id="cite_ref-InsecureComments_58-0" class="reference"><a href="#cite_note-InsecureComments-58"><span class="cite-bracket">[</span>58<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Comparison_of_programming_languages_(syntax)#Comments" title="Comparison of programming languages (syntax)">Comparison of programming languages (syntax)#Comments</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Notes_and_references">Notes and references</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist reflist-columns references-column-width reflist-columns-2">
<ol class="references">
<li id="cite_note-PennyGrubb000-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-PennyGrubb000_1-0">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFPenny_Grubb2003" class="citation book cs1">Penny Grubb, Armstrong Takang (2003). <i>Software Maintenance: Concepts and Practice</i>. World Scientific. pp.&nbsp;7, plese start120–121. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-981-238-426-3</bdi>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFGanguli2002" class="citation book cs1">Ganguli, Madhushree (2002). <i>Making Use of Jsp</i>. New York: Wiley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-471-21974-3</bdi>.</cite>, <cite id="CITEREFHewitt2003" class="citation book cs1">Hewitt, Eben (2003). <i>Java for Coldfusion Developers</i>. Upper Saddle River: Pearson Education. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-13-046180-3</bdi>.</cite></span>
</li>
<li id="cite_note-Dietrich000-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-Dietrich000_3-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFW._R.2003" class="citation book cs1">W. R., Dietrich (2003). <i>Applied Pattern Recognition: Algorithms and Implementation in C++</i>. Springer. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-3-528-35558-6</bdi>.</cite> offers viewpoints on proper use of comments in source code. p. 66.</span>
</li>
<li id="cite_note-Keyes000-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-Keyes000_4-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFKeyes2003" class="citation book cs1">Keyes, Jessica (2003). <i>Software Engineering Handbook</i>. CRC Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-8493-1479-7</bdi>.</cite> discusses comments and the "Science of Documentation" p. 256.</span>
</li>
<li id="cite_note-Higham000-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-Higham000_5-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFHigham2005" class="citation book cs1">Higham, Desmond (2005). <i>MATLAB Guide</i>. SIAM. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-89871-578-1</bdi>.</cite></span>
</li>
<li id="cite_note-Vermeulen000-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-Vermeulen000_6-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFVermeulen2000" class="citation book cs1">Vermeulen, Al (2000). <a rel="nofollow" class="external text" href="https://archive.org/details/elementsofjavast00verm"><i>The Elements of Java Style</i></a>. Cambridge University Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-521-77768-1</bdi>.</cite></span>
</li>
<li id="cite_note-javadude000-7"><span class="mw-cite-backlink">^ <a href="#cite_ref-javadude000_7-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-javadude000_7-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-javadude000_7-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://javadude.com/articles/comments.html">"Using the right comment in Java"</a>. 2000-03-04<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-07-24</span></span>.</cite></span>
</li>
<li id="cite_note-JBDixit000-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-JBDixit000_8-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFDixit2003" class="citation book cs1">Dixit, J.B. (2003). <i>Computer Fundamentals and Programming in C</i>. Laxmi Publications. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-81-7008-882-0</bdi>.</cite></span>
</li>
<li id="cite_note-BadComment000-9"><span class="mw-cite-backlink">^ <a href="#cite_ref-BadComment000_9-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-BadComment000_9-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-BadComment000_9-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><i><a href="The_Elements_of_Programming_Style_(book)" class="mw-redirect" title="The Elements of Programming Style (book)">The Elements of Programming Style</a></i>, <a href="Brian_Kernighan" title="Brian Kernighan">Kernighan</a> &amp; <a href="P._J._Plauger" title="P. J. Plauger">Plauger</a></span>
</li>
<li id="cite_note-GoodComment000-10"><span class="mw-cite-backlink">^ <a href="#cite_ref-GoodComment000_10-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-GoodComment000_10-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><i><a href="Code_Complete" title="Code Complete">Code Complete</a></i>, <a href="Steve_McConnell" title="Steve McConnell">McConnell</a></span>
</li>
<li id="cite_note-AlgoComments-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-AlgoComments_11-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFSpinellis2003" class="citation book cs1">Spinellis, Diomidis (2003). <i>Code reading: The Open Source Perspective</i>. Addison-Wesley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-201-79940-8</bdi>.</cite></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text">See e.g., <cite id="CITEREFWynne-Powell2008" class="citation book cs1">Wynne-Powell, Rod (2008). <a rel="nofollow" class="external text" href="https://archive.org/details/macosxforphotogr0000wynn"><i>Mac OS X for Photographers: Optimized Image Workflow for the Mac User</i></a>. Oxford: Focal Press. p.&nbsp;243. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-240-52027-8</bdi>.</cite></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text">See e.g., <cite id="CITEREFBerlin2006" class="citation book cs1">Berlin, Daniel (2006). <i>Practical Subversion, Second Edition</i>. Berkeley: APress. p.&nbsp;168. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-59059-753-8</bdi>.</cite></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite id="CITEREFLamb1998" class="citation book cs1">Lamb, Linda (1998). <a rel="nofollow" class="external text" href="https://archive.org/details/learningvieditor00lamb"><i>Learning the VI Editor</i></a>. Sebastopol: O'Reilly &amp; Associates. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-56592-426-0</bdi>.</cite></span>
</li>
<li id="cite_note-Ambler000-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-Ambler000_15-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFAmbler2004" class="citation book cs1">Ambler, Scott (2004). <i>The Object Primer: Agile Model-Driven Development with UML 2.0</i>. Cambridge University Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-397-80521-8</bdi>.</cite></span>
</li>
<li id="cite_note-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-16">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/defn">Function definition with docstring in Clojure</a></span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><cite id="CITEREFMurach" class="citation book cs1">Murach. <i>C# 2005</i>. p.&nbsp;56.</cite></span>
</li>
<li id="cite_note-asciiart000-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-asciiart000_18-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070714092702/http://www.codeproject.com/macro/codeplotter.asp">"CodePlotter 1.6 – Add and edit diagrams in your code with this 'Visio-like' tool"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.codeproject.com/macro/codeplotter.asp">the original</a> on 2007-07-14<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-07-24</span></span>.</cite></span>
</li>
<li id="cite_note-Niederst000-19"><span class="mw-cite-backlink">^ <a href="#cite_ref-Niederst000_19-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Niederst000_19-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFNiederst2006" class="citation book cs1">Niederst, Jennifer (2006). <i>Web Design in a Nutshell: A Desktop Quick Reference</i>. O'Reilly. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-596-00987-8</bdi>.</cite>
Sometimes the difference between a "comment" and other syntax elements of a programming or markup language entails subtle nuances. Niederst indicates one such situation by stating: "Unfortunately, XML software thinks of comments as unimportant information and may simply remove the comments from a document before processing it. To avoid this problem, use an XML CDATA section instead."</span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-20">^</a></b></span> <span class="reference-text"><a href="https://wiki.c2.com/?HotComments" class="extiw external" title="c2:HotComments">c2: HotComments</a></span>
</li>
<li id="cite_note-21"><span class="mw-cite-backlink"><b><a href="#cite_ref-21">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.ruby-lang.org/en/2.4.0/Encoding.html">"class Encoding"</a>. <i>Ruby</i>. ruby-lang.org<span class="reference-accessdate">. Retrieved <span class="nowrap">5 December</span> 2018</span>.</cite></span>
</li>
<li id="cite_note-22"><span class="mw-cite-backlink"><b><a href="#cite_ref-22">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.python.org/dev/peps/pep-0263/">"PEP 263 – Defining Python Source Code Encodings"</a>. Python.org<span class="reference-accessdate">. Retrieved <span class="nowrap">5 December</span> 2018</span>.</cite></span>
</li>
<li id="cite_note-23"><span class="mw-cite-backlink"><b><a href="#cite_ref-23">^</a></b></span> <span class="reference-text"><cite id="CITEREFPolacek2017" class="citation web cs1">Polacek, Marek (2017-03-10). <a rel="nofollow" class="external text" href="https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/">"-Wimplicit-fallthrough in GCC 7"</a>. <i>Red Hat Developer</i>. Red Hat<span class="reference-accessdate">. Retrieved <span class="nowrap">10 February</span> 2019</span>.</cite></span>
</li>
<li id="cite_note-24"><span class="mw-cite-backlink"><b><a href="#cite_ref-24">^</a></b></span> <span class="reference-text"><cite id="CITEREFLisa_Eadicicco2014" class="citation web cs1">Lisa Eadicicco (27 March 2014). <a rel="nofollow" class="external text" href="https://www.businessinsider.com/microsoft-hidden-messages-in-word-and-ms-dos-2014-3?r=US&amp;IR=T">"Microsoft Programmers Hid A Bunch Of Profanity In Early Software Code"</a>. <i><a href="Business_Insider_Australia" class="mw-redirect" title="Business Insider Australia">Business Insider Australia</a></i>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20161229170544/http://www.businessinsider.com.au/microsoft-hidden-messages-in-word-and-ms-dos-2014-3?r=US&amp;IR=T">Archived</a> from the original on 29 December 2016.</cite></span>
</li>
<li id="cite_note-SwearWords-25"><span class="mw-cite-backlink"><b><a href="#cite_ref-SwearWords_25-0">^</a></b></span> <span class="reference-text">(see e.g., <a rel="nofollow" class="external text" href="http://www.vidarholen.net/contents/wordcount/">Linux Swear Count</a>).</span>
</li>
<li id="cite_note-26"><span class="mw-cite-backlink"><b><a href="#cite_ref-26">^</a></b></span> <span class="reference-text"><cite id="CITEREFGoodliffe2006" class="citation book cs1">Goodliffe, Pete (2006). <i>Code Craft</i>. San Francisco: No Starch Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-59327-119-0</bdi>.</cite></span>
</li>
<li id="cite_note-27"><span class="mw-cite-backlink"><b><a href="#cite_ref-27">^</a></b></span> <span class="reference-text"><cite id="CITEREFSmith1991" class="citation book cs1">Smith, T. (1991). <i>Intermediate Programming Principles and Techniques Using Pascal</i>. Belmont: West Pub. Co. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-314-66314-6</bdi>.</cite></span>
</li>
<li id="cite_note-28"><span class="mw-cite-backlink"><b><a href="#cite_ref-28">^</a></b></span> <span class="reference-text">See e.g., <cite id="CITEREFKoletzke2000" class="citation book cs1">Koletzke, Peter (2000). <i>Oracle Developer Advanced Forms &amp; Reports</i>. Berkeley: Osborne/McGraw-Hill. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-07-212048-6</bdi>.</cite> page 65.</span>
</li>
<li id="cite_note-BadComments001-29"><span class="mw-cite-backlink"><b><a href="#cite_ref-BadComments001_29-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.sqlservercentral.com/columnists/awarren/worstpracticebadcomments.asp">"Worst Practice - Bad Comments"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2007-07-24</span></span>.</cite></span>
</li>
<li id="cite_note-Morelli000-30"><span class="mw-cite-backlink"><b><a href="#cite_ref-Morelli000_30-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFMorelli2006" class="citation book cs1">Morelli, Ralph (2006). <i>Java, Java, Java: object-oriented problem solving</i>. Prentice Hall College. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-13-147434-5</bdi>.</cite></span>
</li>
<li id="cite_note-Javadoc000-31"><span class="mw-cite-backlink">^ <a href="#cite_ref-Javadoc000_31-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Javadoc000_31-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://java.sun.com/j2se/javadoc/writingdoccomments/">"How to Write Doc Comments for the Javadoc Tool"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2007-07-24</span></span>.</cite> Javadoc guidelines specify that comments are crucial to the platform. Further, the appropriate level of detail is fairly well-defined: "We spend time and effort focused on specifying boundary conditions, argument ranges and corner cases rather than defining common programming terms, writing conceptual overviews, and including examples for developers."</span>
</li>
<li id="cite_note-techniques001-32"><span class="mw-cite-backlink"><b><a href="#cite_ref-techniques001_32-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFYourdon2007" class="citation book cs1">Yourdon, Edward (2007). <i>Techniques of Program Structure and Design</i>. University of Michigan. 013901702X.</cite>Non-existent comments can make it difficult to comprehend code, but comments may be detrimental if they are obsolete, redundant, incorrect or otherwise make it more difficult to comprehend the intended purpose for the source code.</span>
</li>
<li id="cite_note-CmmtPhilosophy-33"><span class="mw-cite-backlink"><b><a href="#cite_ref-CmmtPhilosophy_33-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFDewhurst2002" class="citation book cs1">Dewhurst, Stephen C (2002). <i>C++ Gotchas: Avoiding Common Problems in Coding and Design</i>. Addison-Wesley Professional. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-321-12518-7</bdi>.</cite></span>
</li>
<li id="cite_note-gnome000-34"><span class="mw-cite-backlink"><b><a href="#cite_ref-gnome000_34-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070808173421/http://developer.gnome.org/doc/guides/programming-guidelines/code-style.html">"Coding Style"</a>. Archived from <a rel="nofollow" class="external text" href="http://developer.gnome.org/doc/guides/programming-guidelines/code-style.html">the original</a> on 2007-08-08<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-07-24</span></span>.</cite></span>
</li>
<li id="cite_note-Holub000-35"><span class="mw-cite-backlink"><b><a href="#cite_ref-Holub000_35-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070720153845/http://www.holub.com/company/allen_holub.html">"Allen Holub"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.holub.com/company/allen_holub.html">the original</a> on 2007-07-20<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-07-24</span></span>.</cite></span>
</li>
<li id="cite_note-Holub001-36"><span class="mw-cite-backlink"><b><a href="#cite_ref-Holub001_36-0">^</a></b></span> <span class="reference-text">Allen Holub, <i>Enough Rope to Shoot Yourself in the Foot</i>, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-07-029689-8</bdi>, 1995, McGraw-Hill</span>
</li>
<li id="cite_note-37"><span class="mw-cite-backlink"><b><a href="#cite_ref-37">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.python.org/dev/peps/pep-0350/#what-are-codetags">"PEP 0350 – Codetags"</a>, Python Software Foundation</span>
</li>
<li id="cite_note-38"><span class="mw-cite-backlink"><b><a href="#cite_ref-38">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://medium.com/@eido.askayo/never-forget-anything-before-after-and-while-coding-98d187ae4cf1">"Never Forget Anything Before, After and While Coding"</a>, Using "codetag" comments as productive remainders</span>
</li>
<li id="cite_note-39"><span class="mw-cite-backlink"><b><a href="#cite_ref-39">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://msdn.microsoft.com/en-us/library/txtwdysk.aspx#tokenscomments">"Using the Task List"</a>, msdn.microsoft.com</span>
</li>
<li id="cite_note-40"><span class="mw-cite-backlink"><b><a href="#cite_ref-40">^</a></b></span> <span class="reference-text">
<cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://perldoc.perl.org/perlpod.html">"perlpod – the Plain Old Documentation format"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2011-09-12</span></span>.</cite></span>
</li>
<li id="cite_note-41"><span class="mw-cite-backlink"><b><a href="#cite_ref-41">^</a></b></span> <span class="reference-text">
<cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://search.cpan.org/~bradapp/PodParser-1.20/lib/Pod/ParseUtils.pm">"Pod::ParseUtils – helpers for POD parsing and conversion"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2011-09-12</span></span>.</cite></span>
</li>
<li id="cite_note-perl6-42"><span class="mw-cite-backlink">^ <a href="#cite_ref-perl6_42-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-perl6_42-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text">
<cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.perl6.org/language/syntax#Comments">"Perl 6 Documentation – Syntax (Comments)"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2017-04-06</span></span>.</cite></span>
</li>
<li id="cite_note-triple-43"><span class="mw-cite-backlink">^ <a href="#cite_ref-triple_43-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-triple_43-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20210819164828/https://www.tutorialdocs.com/tutorial/python3/python3-basic-syntax.html">"Python 3 Basic Syntax"</a>. Archived from <a rel="nofollow" class="external text" href="https://www.tutorialdocs.com/tutorial/python3/python3-basic-syntax.html">the original</a> on 19 August 2021<span class="reference-accessdate">. Retrieved <span class="nowrap">25 February</span> 2019</span>. <q>Triple quotes are treated as regular strings with the exception that they can span multiple lines. By regular strings I mean that if they are not assigned to a variable they will be immediately garbage collected as soon as that code executes. hence are not ignored by the interpreter in the same way that #a comment is.</q></cite></span>
</li>
<li id="cite_note-44"><span class="mw-cite-backlink"><b><a href="#cite_ref-44">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://twitter.com/gvanrossum/status/112670605505077248">"Python tip: You can use multi-line strings as multi-line comments"</a>, 11 September 2011, Guido van Rossum</span>
</li>
<li id="cite_note-45"><span class="mw-cite-backlink"><b><a href="#cite_ref-45">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.haskell.org/haskellwiki/Literate_programming#Bird_Style">"Literate programming"</a>. <i>haskell.org</i>.</cite></span>
</li>
<li id="cite_note-46"><span class="mw-cite-backlink"><b><a href="#cite_ref-46">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.lua.org/pil/1.3.html">"Programming in Lua 1.3"</a>. <i>www.Lua.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2017-11-08</span></span>.</cite></span>
</li>
<li id="cite_note-MSSQL-47"><span class="mw-cite-backlink"><b><a href="#cite_ref-MSSQL_47-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFTalmage1999" class="citation book cs1">Talmage, Ronald R. (1999). <a rel="nofollow" class="external text" href="https://archive.org/details/microsoftsqlserv00talm"><i>Microsoft SQL Server 7</i></a>. Prima Publishing. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-7615-1389-6</bdi>.</cite></span>
</li>
<li id="cite_note-MySQL-48"><span class="mw-cite-backlink"><b><a href="#cite_ref-MySQL_48-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://dev.mysql.com/doc/refman/8.0/en/comments.html">"MySQL 8.0 Reference Manual"</a>. Oracle Corporation<span class="reference-accessdate">. Retrieved <span class="nowrap">January 2,</span> 2020</span>.</cite></span>
</li>
<li id="cite_note-SQLite-49"><span class="mw-cite-backlink"><b><a href="#cite_ref-SQLite_49-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.sqlite.org/lang_comment.html">"SQL As Understood By SQLite"</a>. SQLite Consortium<span class="reference-accessdate">. Retrieved <span class="nowrap">January 2,</span> 2020</span>.</cite></span>
</li>
<li id="cite_note-PostgreSQL-50"><span class="mw-cite-backlink"><b><a href="#cite_ref-PostgreSQL_50-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.postgresql.org/docs/10/sql-syntax-lexical.html#SQL-SYNTAX-COMMENTS">"PostgreSQL 10.11 Documentation"</a>. The PostgreSQL Global Development Group<span class="reference-accessdate">. Retrieved <span class="nowrap">January 2,</span> 2020</span>.</cite></span>
</li>
<li id="cite_note-Oracle-51"><span class="mw-cite-backlink"><b><a href="#cite_ref-Oracle_51-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.oracle.com/cd/B13789_01/server.101/b10759/sql_elements006.htm">"Oracle® Database SQL Reference"</a>. Oracle Corporation<span class="reference-accessdate">. Retrieved <span class="nowrap">January 2,</span> 2020</span>.</cite></span>
</li>
<li id="cite_note-52"><span class="mw-cite-backlink"><b><a href="#cite_ref-52">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://learningnetwork.cisco.com/thread/71302">"Leave a comment in running-config"</a>. <i>Cisco Learning Network (discussion forum)</i>.</cite></span>
</li>
<li id="cite_note-53"><span class="mw-cite-backlink"><b><a href="#cite_ref-53">^</a></b></span> <span class="reference-text"><cite id="GUID-657D5FD4-32C5-444C-BCE0-BC2CC1069005" class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/config-mgmt/configuration/xe-3s/asr903/config-mgmt-xe-3s-asr903-book/cm-config-files.html">"Managing Configuration Files Configuration Guide, Cisco IOS XE Release 3S (ASR 900 Series)"</a>.</cite></span>
</li>
<li id="cite_note-54"><span class="mw-cite-backlink"><b><a href="#cite_ref-54">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://nim-lang.github.io/Nim/macros.html#extractDocCommentsAndRunnables%2CNimNode">macros.extractDocCommentsAndRunnables</a></span>
</li>
<li id="cite_note-55"><span class="mw-cite-backlink"><b><a href="#cite_ref-55">^</a></b></span> <span class="reference-text"><cite id="CITEREFKathleen_Jensen,_Niklaus_Wirth1985" class="citation book cs1">Kathleen Jensen, Niklaus Wirth (1985). <i>Pascal User Manual and Report</i>. Springer-Verlag. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-387-96048-1</bdi>.</cite></span>
</li>
<li id="cite_note-56"><span class="mw-cite-backlink"><b><a href="#cite_ref-56">^</a></b></span> <span class="reference-text"><cite id="CITEREFNiklaus_Wirth1983" class="citation book cs1">Niklaus Wirth (1983). <i>Programming in Modula-2</i>. Springer-Verlag. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-387-15078-1</bdi>.</cite></span>
</li>
<li id="cite_note-57"><span class="mw-cite-backlink"><b><a href="#cite_ref-57">^</a></b></span> <span class="reference-text">*<cite id="CITEREFMartin_Reiser,_Niklaus_Wirth1992" class="citation book cs1">Martin Reiser, Niklaus Wirth (1992). <i>Programming in Oberon</i>. Addison-Wesley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>0-201-56543-9</bdi>.</cite></span>
</li>
<li id="cite_note-InsecureComments-58"><span class="mw-cite-backlink"><b><a href="#cite_ref-InsecureComments_58-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFAndress2003" class="citation book cs1">Andress, Mandy (2003). <i>Surviving Security: How to Integrate People, Process, and Technology</i>. CRC Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-8493-2042-2</bdi>.</cite></span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li>Movshovitz-Attias, Dana and Cohen, William W. (2013) <a rel="nofollow" class="external text" href="https://www.cs.cmu.edu/~dmovshov/papers/dma_acl2013.pdf">Natural Language Models for Predicting Programming Comments</a>. In Association for Computational Linguistics (ACL), 2013.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20110708033309/http://dkrukovsky.blogspot.com/2005/07/how-to-write-comments.html">How to Write Comments</a> by Denis Krukovsky</li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070722211609/http://www.ptlogica.com/TwinText/resource/liveuser.pdf">Source Code Documentation as a Live User Manual</a> by PTLogica</li>
<li><a rel="nofollow" class="external text" href="https://www.oracle.com/technetwork/java/javase/tech/index-137868.html">How to Write Comments for the Javadoc Tool</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-26" href="https://en.wikipedia.org/wiki/?title=Comment_(computer_programming)&amp;oldid=1302652744">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>